# -*- coding: utf-8 -*-
import tensorflow as tf
from train_model.dataset import tokenizer
from train_model import utils, settings

# 加载训练好的模型
model = tf.keras.models.load_model(settings.BEST_MODEL_PATH)
# 随机生成一首诗
# print(utils.generate_random_poetry(tokenizer, model))
# # 给出部分信息的情况下，随机生成剩余部分
# print(utils.generate_random_poetry(tokenizer, model, s='床前明月光，'))
# # 生成藏头诗
# print(utils.generate_acrostic(tokenizer, model, head='海阔天空'))
# 使用 Beam Search
print(utils.generate_beam_search(tokenizer, model, s='床前明月光，'))
# 使用 Top-k Sampling 
print(utils.generate_top_k_sampling(tokenizer, model))


